package com.kyzh.core.adapters

import android.util.Log
import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gushenge.atools.util.setHeight
import com.gushenge.atools.util.setWidth
import com.kyzh.core.R
import com.kyzh.core.utils.SampleCoverVideo
import com.kyzh.core.utils.ViewUtils.dp
import com.kyzh.core.utils.loadImage
import com.kyzh.core.utils.loadImage1
import com.kyzh.core.utils.setVisibility
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView

class Dynamic1Adapter(layout:Int, var bean:ArrayList<String>?, var video: String?, var aotoBoFang :Boolean= false):BaseQuickAdapter<String,
        BaseViewHolder>
    (layout,
    bean) {
    override fun convert(helper: BaseViewHolder, item: String) {
        val view = helper.getView<ImageView>(R.id.image)
            if(bean?.size==1){
                view.setHeight(151.dp)
                view.setWidth(306.dp)
            }else if(bean?.size ==2){
                view.setWidth(148.dp)
                view.setHeight(95.dp)
            }else{
                view.setWidth(95.dp)
                view.setHeight(78.dp)
            }
            view.setVisibility(true)
            if(!item.contains(" ")){
                view.loadImage1(item)

        }
    }
}
